<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>table</title>
<link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>

<table class="layui-hide" id="test" lay-filter="demo"></table>


<script src="../layui/layui.js"></script>
<script type="text/javascript">
layui.use('table', function(){
	  var table = layui.table;	  
	  table.render({
	    elem: '#test'
	    ,url:'../table_data'
	    ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
	    ,cols: [[
	    	{type:'checkbox'}
	      ,{field:'id', width:150, title: 'ID'}
	      ,{field:'priority', width:150, title: '优先级'}
	      ,{field:'name', minwidth:150, title: '分类名称'}     
	    ]]
	//加入数据
      ,data: [
    	  {"id":1,"priority":2,"name":1}
    	  ,{"id":2,"priority":2,"name":2}
    	  ,{"id":3,"priority":2,"name":3}  	  
      ]
	  });
	  
      
	});
</script>
</body>
</html>